<?php
/**
 * @link http://cn2.php.net/manual/en/migration54.incompatible.php
 * @version $Id: 5_break.php 211 2012-03-02 10:56:14Z horseluke@126.com $
 */

/*
The break and continue statements no longer accept variable arguments 
(e.g., break 1 + foo() * $bar;). Static arguments still work, such as break 2;.

PHP 5.3:
v2:1
v2:1

PHP 5.4:
Fatal error: 'continue' operator with non-constant operand is no longer supporte
d in \php_5_4\5_break.php on line 32

*/
error_reporting(E_ALL);

$arr = array(1=>array(1,2,3,4));

//test1
foreach($arr as $k1 => $v1){
	foreach($v1 as $k2 => $v2){
		echo 'v2:'. $v2. "\r\n";
		continue 2;
	}
	echo "k1:{$k1} finish\r\n";
}

//test2
$continue = 2;
foreach($arr as $k1 => $v1){
	foreach($v1 as $k2 => $v2){
		echo 'v2:'. $v2. "\r\n";
		continue $continue;
	}
	echo "k1:{$k1} finish\r\n";
}